package priv.yiyuan.example.design.pay02;

/**
 * 支付解析方法类
 *
 * @author YiYuan
 * @data 2025/8/8
 * @apoNote
 */
public class PaymentProcessorUtil {

    public static void processOrderPayment(double amount, String method, String details) {
        System.out.println("\n=== Processing order payment ===");
        UnifiedPayment paymentMethod = PaymentProcessor.getPaymentMethod(method);

        if (paymentMethod != null) {
            new PaymentProcessor(paymentMethod).executePayment(amount, details);
        }
        else {
            System.out.println("Error: Payment method '" + method + "' not found!");
        }
    }

}
